home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Die Speccy' 97
/
Die Speccy' 97.iso
/
amiga_system
/
the_aminet
/
comm
/
net
/
amipop118.lha
/
AmiPOP118
/
source
/
pop_temp.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-21
|
5KB
|
241 lines
/* This file contains empty template routines that
* the IDCMP handler will call uppon. Fill out these
* routines with your code or use them as a reference
* to create your program.
*/
#include "pop.h"
int MYGAD_USERClicked( void )
{
/* routine when gadget "_Username" is clicked. */
closecx();
strcpy(username,MyGetString(Project0Gadgets[GD_MYGAD_USER]));
setupcx();
return(0);
}
int MYGAD_PASSWORDClicked( void )
{
/* routine when gadget "_Password" is clicked. */
return(0);
}
int MYGAD_DELETEClicked( void )
{
/* routine when gadget "_Delete Mail" is clicked. */
delmail= (!delmail);
return(0);
}
int MYGAD_MAILBOXClicked( void )
{
/* routine when gadget "Mail _Box" is clicked. */
closecx();
strcpy(mailbox,MyGetString(Project0Gadgets[GD_MYGAD_MAILBOX]));
setupcx();
return(0);
}
int MYGAD_BUTTONClicked( void )
{
/* routine when gadget "_Check Now" is clicked. */
struct Requester *BusyRequester;
if (Project0Wnd)
{
if (BusyRequester=AllocVec(sizeof(struct Requester),MEMF_CLEAR))
{
DoFmt(title,"Connecting to %s",pophost);
settitle(title);
Request(BusyRequester,Project0Wnd);
#ifdef OS30
SetWindowPointer( Project0Wnd,
WA_BusyPointer, TRUE,
TAG_DONE );
#else
SetPointer(Project0Wnd, waitPointer, 16, 16, -6, 0);
#endif
}
}
if (dopop())
{
doreq("An error has occured.",bum);
}
if (Project0Wnd)
{
#ifdef OS30
SetWindowPointer( Project0Wnd,
TAG_DONE );
#else
ClearPointer(Project0Wnd);
#endif
EndRequest(BusyRequester,Project0Wnd);
FreeVec(BusyRequester);
SetWindowTitles(Project0Wnd,Project0Wdt, (UBYTE *) ~0); /* Restore title */
}
return(0);
}
int MYGAD_HOSTClicked( void )
{
/* routine when gadget "POP _Host" is clicked. */
closecx();
strcpy(pophost,MyGetString(Project0Gadgets[GD_MYGAD_HOST]));
setupcx();
return(0);
}
int MYGAD_TIMEClicked( void )
{
/* routine when gadget "How _Often" is clicked. */
AbortIO( (struct IORequest *)timerio);
WaitIO( (struct IORequest *)timerio);
Wait( 1L << timer_mp->mp_SigBit );
timecheck=(int)MyGetNumber(Project0Gadgets[GD_MYGAD_TIME]);
timereq();
return(0);
}
int MYGAD_CRONCHECKClicked( void )
{
/* routine when gadget "Check _Periodically" is clicked. */
checkper= (!checkper);
if (!checkper)
{
ActivateCxObj(broker, 0L);
}
else
{
ActivateCxObj(broker, 1L);
}
GT_SetGadgetAttrs(Project0Gadgets[GD_MYGAD_TIME], Project0Wnd, NULL, GA_Disabled, !checkper,TAG_END);
return(0);
}
int MYGAD_APPENDClicked( void )
{
/* routine when gadget "_Append to MailBox?" is clicked. */
appfile= (!appfile);
return(0);
}
int Project0MENU_HIDE( void )
{
/* routine when (sub)item "Hide" is selected. */
closedown();
return(TRUE);
}
int Project0MENU_ABOUT( void )
{
/* routine when (sub)item "About..." is selected. */
doreq("AmiPOP - A POP3 Client\nBy Scott Ellis","Wow");
return(TRUE);
}
int Project0MENU_QUIT( void )
{
/* routine when (sub)item "Quit" is selected. */
return(FALSE);
}
int Project0CloseWindow( void )
{
/* routine for "IDCMP_CLOSEWINDOW". */
closedown();
return(TRUE);
}
int Project0VanillaKey( void )
{
/* routine for "IDCMP_VANILLAKEY". */
UWORD imsgCode;
imsgCode=Project0Msg.Code;
switch(imsgCode)
{
case 'p':
case 'P':
ActivateGadget(Project0Gadgets[GD_MYGAD_HOST], Project0Wnd,NULL);
break;
case 'u':
case 'U':
ActivateGadget(Project0Gadgets[GD_MYGAD_USER], Project0Wnd,NULL);
break;
case 'w':
case 'W':
ActivateGadget(Project0Gadgets[GD_MYGAD_PASSWORD], Project0Wnd,NULL);
MYGAD_PASSWORDClicked();
break;
case 'b':
case 'B':
ActivateGadget(Project0Gadgets[GD_MYGAD_MAILBOX], Project0Wnd,NULL);
break;
case 'o':
case 'O':
if (checkper)
{
ActivateGadget(Project0Gadgets[GD_MYGAD_TIME], Project0Wnd,NULL);
}
break;
case 'n':
case 'N':
MYGAD_BUTTONClicked();
break;
case 'c':
case 'C':
MYGAD_CRONCHECKClicked();
GT_SetGadgetAttrs(Project0Gadgets[GD_MYGAD_CRONCHECK], Project0Wnd, NULL, GTCB_Checked, checkper,TAG_END);
break;
case 'd':
case 'D':
MYGAD_DELETEClicked();
GT_SetGadgetAttrs(Project0Gadgets[GD_MYGAD_DELETE], Project0Wnd, NULL, GTCB_Checked, delmail,TAG_END);
break;
case 'a':
case 'A':
MYGAD_APPENDClicked();
GT_SetGadgetAttrs(Project0Gadgets[GD_MYGAD_APPEND], Project0Wnd, NULL, GTCB_Checked, appfile,TAG_END);
break;
}
return(0);
}
int Project0ChangeWindow( void )
{
/* routine for "IDCMP_CHANGEWINDOW". */
return(0);
}